<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
</head>
<body>
  <header class="aui-bar aui-bar-nav" id="aui-header">
      <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
          <span class="aui-iconfont aui-icon-left"></span>
      </a>
      <a id="play" class="aui-btn aui-pull-right" tapmode onclick="jieXi()">
          换线
      </a>
  </header>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript">
    var jxlist='';
    apiready = function(){
      api.parseTapmode();
        api.setScreenOrientation({
            orientation: 'auto'
        });
      var header = $api.byId('aui-header');
      $api.fixStatusBar(header);
      var headerPos = $api.offset(header);
      var body_h = $api.offset($api.dom('body')).h;
      jxlist=updatelist(0,function(retlist){if(retlist)jxlist=retlist;});
      api.addEventListener({
          name: 'keyback'
      }, function(ret, err) {
        api.closeWin();
      });
      var browser = api.require('webBrowser');
      browser.openView({
          url: api.pageParam.url,
          rect: {
              x: 0,
              y: 0,
              w: 'auto',
              h: 'auto'
          }
      }, function(ret, err) {
          switch (ret.state) {//加载状态，数字类型，取值范围：0-开始加载；1-加载进度发生变化；2-结束加载；3-title发生变化；4-url发生变化
              case 0:
                  break;
              case 1:
                  break;
              case 2:
                  break;
              case 3:
                  break;
              case 4:
                  break;
              default:
                  break;
          };
      });
    }
    function closeWin(){
      api.closeWin();
    }
    function jieXi(){
        if(is_empty(jxlist))jxlist=[jx_url1];
        var buttons=[];
        for(var i in jxlist){
            var num = parseInt(i)+1;
            buttons.push('VIP线路'+num);
        }
      api.actionSheet({
          title: 'VIP影视VIP线路',
          cancelTitle: '取消',
          buttons:buttons
      }, function(ret, err) {
          var index = ret.buttonIndex;
          var index = ret.buttonIndex;
          var jx_url = jxlist[(index-1)];
          vipHuanxian(jx_url);
      });
    }
    function vipHuanxian(jiekou){
      api.hideProgress();
      var browser = api.require('webBrowser');
      browser.loadUrl({
          url: jiekou+encodeURIComponent(api.pageParam.url)
      });
    }
</script>
</html>